package nl.hr.cmi.opleiding.database;

import java.text.SimpleDateFormat;
import java.util.Date;

import android.widget.PopupWindow;

import com.j256.ormlite.field.DatabaseField;

public class DBShowcaseItem {

	public static final int TYPE_APP = 0;
	public static final int TYPE_WEBSITE = 1;

	public static final int PLATFORM_ANDROID = 0;
	public static final int PLATFORM_WP7 = 1;
	
	public static final int POPULARITY_FEATURED=99;

	@DatabaseField(generatedId = true)
	int id;
	@DatabaseField(index = true)
	String title;
	@DatabaseField
	String subtitle;
	@DatabaseField
	Date date;
	@DatabaseField
	String text;
	@DatabaseField
	String movie;
	@DatabaseField
	String market;
	@DatabaseField
	int platform;
	@DatabaseField
	String afbeelding;
	@DatabaseField
	private
	int popularity;

	public String getAfbeelding() {
		return afbeelding;
	}

	public void setAfbeelding(String afbeelding) {
		this.afbeelding = afbeelding;
	}

	public DBShowcaseItem() {
	}

	public DBShowcaseItem(long millis) {

	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSubtitle() {
		return subtitle;
	}

	public void setSubtitle(String subtitle) {
		this.subtitle = subtitle;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getMovie() {
		return movie;
	}

	public void setMovie(String movie) {
		this.movie = movie;
	}

	public String getMarket() {
		return market;
	}

	public void setMarket(String market) {
		this.market = market;
	}

	public int getPlatform() {
		return platform;
	}

	public void setPlatform(int platform) {
		this.platform = platform;
	}

	public DBShowcaseItem( String title, String subtitle, String text, Date date, String movie, String market, int platform,String afbeelding,int popularity) {
		this.title = title;
		this.subtitle = title;
		this.movie = movie;
		this.date = date;
		this.text = text;
		this.market = market;
		this.platform = platform;
		this.afbeelding = afbeelding;
		this.popularity = popularity;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("id=").append(id);
		sb.append(", ").append("title=").append(title);
		sb.append(", ").append("subtitle=").append(subtitle);
		SimpleDateFormat dateFormatter = new SimpleDateFormat(
				"MM/dd/yyyy HH:mm:ss.S");
		sb.append(", ").append("date=").append(dateFormatter.format(date));
		sb.append(", ").append("text=").append(text);
		sb.append(", ").append("movie=").append(movie);
		sb.append(", ").append("market=").append(market);
		sb.append(", ").append("platform=").append(platform);
		sb.append(", ").append("afbeelding=").append(afbeelding);
		sb.append(", ").append("popularity=").append(popularity);
		return sb.toString();
	}

	int getPopularity() {
		return popularity;
	}

	void setPopularity(int popularity) {
		this.popularity = popularity;
	}

}
